package edu.unl.bsm.CoolingLoad.testing;

import java.io.IOException;
import java.text.ParseException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import jxl.read.biff.BiffException;


import edu.unl.bsm.CoolingLoad.Dao.ARCHIVE_DBDaoImpl;
import edu.unl.bsm.CoolingLoad.Data.IData;
import edu.unl.bsm.CoolingLoad.Data.IWeatherDataWeek;
import edu.unl.bsm.CoolingLoad.JPA.Entity.PermanentHistoryData;
import edu.unl.bsm.CoolingLoad.Util.Utility;


public class NoaaDataWeekDays implements IWeatherDataWeek{
	
	private IData histNoaaData;
	private IData forcastNoaaData;
	


	public NoaaDataWeekDays() throws BiffException, IOException {
		this.histNoaaData = new NoaaData();
		this.forcastNoaaData = new NoaaData();
	}
	
	
	/**
	 * @param histNoaaData the histNoaaData to set
	 * @throws ParseException 
	 * @throws IOException 
	 */
	public void readHistWeatherData() throws ParseException, IOException {
		
		ReadExcel re =  new ReadExcel();
		re.setInputFile("c:/CoolingLoadProject/Data 20100101-20121231.xls");
		List<Object[]> data = re.readData();
		
		histNoaaData.read(data);
	}
	/**
	 * 
	 * @return return the HistnooaData from Database 
	 * @throws ParseException 
	 */
	public IData getHistWeatherData(){
		return this.histNoaaData;
		
	}
	/**
	 * get next 24 hours data from database
	 * @throws ParseException
	 * @throws IOException 
	 */
	public void readForecastWeatherData() throws ParseException, IOException {
		ReadExcel re =  new ReadExcel();
		re.setInputFile("c:/CoolingLoadProject/Data 20100101-20121231.xls");
		List<Object[]> data = re.readForcastData();
		
		
		 forcastNoaaData.read(data);
	}
	
	public IData getForecastWeatherData(){
		return this.forcastNoaaData;
		
	}
	
	
}
